package wwy.Entity.CommonEntity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.OneToMany;
import lombok.Getter;
import lombok.Setter;
import wwy.Common.orgEntity.LogicEntity;
import wwy.Entity.OrderItem;

import java.util.Set;

@Entity
@Getter
@Setter
public class Foods extends LogicEntity {
    private String name;
    private String description;
    private Double price;

    @OneToMany(mappedBy = "food",
            fetch = FetchType.LAZY,
            cascade = CascadeType.ALL)
    @JsonIgnoreProperties("food")
    private Set<OrderItem> orderItems;

}
